#pragma once

#include <hgeanim.h>
#include <hgeparticle.h>
#include "GameObj.h"
#include "Bullet.h"

class PlayerObj : public GameObj
{
public:
	PlayerObj(
		hgeAnimation* player,
		hgeSprite* spr1,
		hgeSprite* spr2,
		hgeSprite* spr3,
		hgeSprite* shift,
		hgeSprite* PlayerMainBullet,
		hgeSprite* PlayerTraceBulletA,
		hgeSprite* PlayerTraceBulletB,
		hgeSprite* PlayerTraceBulletC,
		hgeSprite* PlayerBoom,
		HEFFECT bulletEffect,
		HEFFECT boomEffect,
		HEFFECT shiftEffect,
		hgeParticleSystem * part,
		float speed,float _x,float _y);
	virtual ~PlayerObj();

	void MoveUp();
	void MoveDown();
	void MoveRight();
	void MoveLeft();
	void noMove();
	void ZFight();
	void XFight();
	void setShift();
	void unsetShift();
	virtual void Update();
	virtual void Render();
	virtual hgeRect* getCollision(hgeRect* rect);
	int checkCollision(hgeRect* rect);
	float getX(){return m_x;}
	float getY(){return m_y;}
	void lockTarget(float x, float y);
	void unlockTarget();
	void MakeDmg(int dmg);
	inline void BoomRender();
	bool isBooming();
	int getBoom(){return m_booms;}
	int getLife(){return m_life;}

private:
	hgeAnimation *m_player;
	hgeSprite *m_spr1,*m_spr2,*m_spr3,*m_shift;
	hgeSprite *m_PlayerMainBullet,*m_PlayerTraceBulletA,*m_PlayerTraceBulletB,*m_PlayerTraceBulletC;
	hgeSprite *m_PlayerBoom;
	BulletManager m_bulletMan;
	float m_x,m_y,m_speed,m_rad,m_r;//m_r is rotation of SPRs r
	float m_vx, m_vy;  // Speed of trace bullet
	int m_life; //how many life do you have?
	bool m_isShift;
	int m_booms;
	float m_boomTime;
	hgeParticleSystem *m_part;
	HEFFECT m_BulletEffect,m_BoomEffect,m_shiftEffect;
};